package com.itheima.arr;

import java.util.Arrays;
import java.util.Scanner;

public class Demo02 {
    public static void main(String[] args) {
        int[] arr={11, 22, 33, 44, 55, 66, 77, 88, 99};

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字");
        int number = sc.nextInt();
        int index=-1;
        for (int i = 0; i < arr.length; i++) {
            //arr[i]
            if(arr[i]==number){
               // System.out.println(i);
                index=i;
                break;
            }
        }
        //int index = Arrays.binarySearch(arr, number);
        System.out.println(index);// -6 = -1 -5  返回值  -插入点-1


    }
}
